Skip to content

DYN-8977 Create global.json dynamically#16266

Merged
zeusongit merged 5 commits into
DynamoDS:masterfrom
avidit:feature/DYN-8977
Jun 4, 2025
Merged

DYN-8977 Create global.json dynamically#16266
zeusongit merged 5 commits into
DynamoDS:masterfrom
avidit:feature/DYN-8977

Conversation

@avidit

@avidit avidit commented Jun 4, 2025

Copy link
Copy Markdown
Contributor

Purpose

Remove .net global.json and create it dynamically for github build actions

Declarations

Check these if you believe they are true

  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB
  • This PR introduces new feature code involve network connecting and is tested with no-network mode.

Release Notes

N/A

Reviewers

@DynamoDS/dynamo

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

Copilot AI review requested due to automatic review settings June 4, 2025 14:49

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8977

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the static global.json files and creates them dynamically during GitHub Actions builds to enable updated .NET SDK configuration.

  • Removed global.json files from the src and test directories.
  • Added steps in multiple GitHub Actions workflows (dynamo_bin_diff.yml, build_dynamo_core.yml, build_dynamo_all.yml) to dynamically generate global.json with SDK version 8.0.100 and rollForward set to "latestFeature".

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/global.json Removed static global.json file from the test directory.
src/global.json Removed static global.json file from the src directory.
.github/workflows/dynamo_bin_diff.yml Added dynamic global.json creation steps in two build jobs.
.github/workflows/build_dynamo_core.yml Added dynamic global.json creation to the build core workflow.
.github/workflows/build_dynamo_all.yml Added dynamic global.json creation to the build all workflow.

Comment thread .github/workflows/dynamo_bin_diff.yml Outdated
Comment thread .github/workflows/dynamo_bin_diff.yml Outdated
Comment thread .github/workflows/build_dynamo_core.yml Outdated
Comment thread .github/workflows/build_dynamo_all.yml Outdated
}
}
"@
$globalJson | Out-File -FilePath ${{ github.workspace }}\Dynamo\global.json -Encoding utf8

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did the dotnet command not work for some reason?

@avidit avidit Jun 4, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did, but I couldn't figure out how to add projects with dotnet add globalJson.
We could run dotnet add command twice (for src and test folders) or this.

run: |
$globalJson = @"
{
"projects": ["src", "test"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this do anything ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avidit avidit Jun 4, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with projects array, global.json applies to all projects in the folders which avoids the need of adding it in different places.

@aparajit-pratap

Copy link
Copy Markdown
Contributor

I'm curious: Why do these actions suddenly need a global.json file for the SDK version? How were they working before?

@pinzart90

Copy link
Copy Markdown
Contributor

I'm curious: Why do these actions suddenly need a global.json file for the SDK version? How were they working before?

We suddenly need it because the git actions build machines were updated with more dotnet sdk versions. Our builds are getting some of the dependencies confused (net8 tooling vs net9 tooling). This is why the global.json config was made https://learn.microsoft.com/en-us/dotnet/core/tools/global-json

run: |
dotnet restore ${{ github.workspace }}\master\src\Dynamo.All.sln /p:Configuration=Release --runtime=win-x64 -p:DotNet=net8.0
run: dotnet restore ${{ github.workspace }}\master\src\Dynamo.All.sln /p:Configuration=Release --runtime=win-x64 -p:DotNet=net8.0
- name: Build Dynamo with MSBuild

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the -p:DotNet=net8.0 not used in the previous dotnet restore in line 41?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pinzart90 Correct me if I am wrong, I think we can remove it here as well, net8.0 is the default
https://github.com/DynamoDS/Dynamo/blob/master/src/Config/CS_SDK.props#L9

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avidit can you make that change, and then we can merge

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@avidit avidit requested a review from zeusongit June 4, 2025 18:17
@zeusongit zeusongit merged commit a63616c into DynamoDS:master Jun 4, 2025
25 of 27 checks passed
@avidit avidit deleted the feature/DYN-8977 branch June 4, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants